Downhole tools in the oil industry typically consist of metallic parts that are often moving and chafing against one another or the borehole wall or the mud/hydrocarbon fluid mix passing through or alongside the surfaces of such downhole tools. As a result corrosion occurs. Such downhole tools can take on various forms including drill collars, Logging While Drilling (LWD) tools, imaging tools having electrode pads, etc.
These downhole tools have metallic bodies with surfaces that are exposed to various types of corrosion:                Electrochemical corrosion can occur when a metal is immersed in a conductive medium.        Galvanic or bimetallic corrosion occurs when two metals in contact are immersed in the same fluid.        Concentration cell corrosion occurs when the same metal is immersed in a fluid, the composition of which varies from one point to another.        Pitting is a type of corrosion involving loss of metal in localized areas, thus forming small sharp cavities. It involves two electrochemical reactions: dissolving the metal into ions and turning oxygen atoms into oxide ions. Pitting requires 3 components to take place: Chlorides (bromides are even worse), Moisture and Oxygen.        Other corrosion processes that can cause problems downhole are stress corrosion, hydrogen embrittlement and chemical corrosion.        
It has been estimated that 1% of the total operating costs of the petroleum industry could be saved by correct application of existing corrosion protection technology. These are particular useful savings considered in light: of the magnitude of the operating costs in this industry. Corrosion control is particularly cost-effective for deep or remote wells, those expected to have a long lifetime or for wells producing carbon dioxide CO2 or hydrogen sulfide H2S.
All types of corrosion mechanisms can be observed during the drilling operation. In particular, in case of logging while drilling, the logging tool stays in contact with different types of mud for a long time. Most water-based muds are considered as a corrosive environment because they contain Chlorides (typically sodium chloride NaCl, and also potassium chloride KCl). If mud systems have foaming tendencies, or a few air bubbles are taken into the pumps, the oxygen dissolved at high-pressure and can also lead to severe corrosion. pH and temperature both act as catalysts for the corrosion reactions. In addition, non-corrosive metal loss can be caused by abrasion from circulating fluids and solids or by mechanical wear. Hydrogen sulfide, carbon dioxide, oxygen and chloride ions are known to enhance corrosion, though the mechanisms by which they act are very different.
Corrosion can be reduced by reduced corrosion resistant metals, but manufacturing the drilling tool parts out of such materials can be costly and precludes existing tools. It is also possible to protect against certain type of corrosion by introducing chemical inhibitors into the mud/hydrocarbon fluid, but this requires a delivery system to inject the chemical inhibitors and also time for the chemical processes to occur.
It is therefore desirable to mitigate against corrosion of downhole tools, which overcomes the aforementioned disadvantages.